< previous page page_635 next page >

Page 635
Table 31.3 Format Property Values.
ValueExample
0-dtpLongDateSaturday, January 01, 2000
1-dtpShortDate1/1/00
3-dtpTime12:00:00 AM
4-dtpCustomWhen you choose this format, youll need to fill in the CustomFormat property using special format characters. See the next section for examples of using the CustomFormat property.

Using the CustomFormat Property
Several format characters are available that you can use to create a special date format. For example, a single uppercase M represents the month, and a single lowercase d represents the day. If you use two of the format characters together, any single digit will be preceded with a leading zero. For example, d would display 1, whereas dd would display 01. Table 31.4 shows you a few ways you can use the CustomFormat property and provides examples of how each date will look at runtime.
Table 31.4 CustomFormat Property Values.
ValueExample
M/dd/yyy (dddd)1/01/2000 (Saturday)
M/d/yy1/1/00
MMM, d Year: yyyJan, 1 Year: 2000

Check the online help for more information on the CustomFormat property.
Callback Formats
One of the other custom format characters you can use is the X character. When you use this custom format, two events are called that you can use to write some data back into the DateTimePicker control. As an example, you might fill in the CustomFormat property with this string:
9f31265bb40b592b1929e18a47ab28e5.gif
MMM ddd yyy (XXXXX)

 
< previous page page_635 next page >

If you like this book, buy it!